// Copyright 2023 Google Inc. Use of this source code is governed by an
// MIT-style license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.

type InterpolationExample = [
  {weight: number; method?: string},
  [number, number, number]
];

// These interpolations are the result of mixing `pink` as the primary color
// with `blue` as the secondary color, with the specified `weight` and for polar
// spaces, the hue interpolation method `method`. These were calculated using
// [Color.js](https://colorjs.io/).
export const interpolations: {[space: string]: InterpolationExample[]} = {
  lab: [
    [
      {
        weight: 0.5,
      },
      [58.614201693004674, 10.016667522478151, -8.387819651868517],
    ],
    [
      {
        weight: 1,
      },
      [78.27047872644108, 35.20288139978972, 1.0168442562642044],
    ],
    [
      {
        weight: 0,
      },
      [38.957924659568256, -15.169546354833418, -17.792483560001216],
    ],
  ],
  oklab: [
    [
      {
        weight: 0.5,
      },
      [0.6476500060804854, 0.027485511076670896, -0.023408311310399166],
    ],
    [
      {
        weight: 1,
      },
      [0.8241000051752044, 0.10608808769190603, 0.0015900461037656743],
    ],
    [
      {
        weight: 0,
      },
      [0.47120000698576636, -0.05111706553856424, -0.048406668724564006],
    ],
  ],
  lch: [
    [
      {
        weight: 0.5,
      },
      [58.614201693004674, 29.299457976259603, 295.6021198088788],
    ],
    [
      {
        weight: 1,
      },
      [78.27047872644108, 35.21756424128674, 1.6545432253797685],
    ],
    [
      {
        weight: 0,
      },
      [38.957924659568256, 23.381351711232465, 229.54969639237788],
    ],
    [
      {
        weight: 0.5,
        method: 'shorter',
      },
      [58.614201693004674, 29.299457976259603, 295.6021198088788],
    ],
    [
      {
        weight: 0.5,
        method: 'longer',
      },
      [58.614201693004674, 29.299457976259603, 115.6021198088788],
    ],
    [
      {
        weight: 0.5,
        method: 'increasing',
      },
      [58.614201693004674, 29.299457976259603, 115.6021198088788],
    ],
    [
      {
        weight: 0.5,
        method: 'decreasing',
      },
      [58.614201693004674, 29.299457976259603, 295.6021198088788],
    ],
  ],
  oklch: [
    [
      {
        weight: 0.5,
      },
      [0.6476500060804854, 0.0882500012863419, 292.1493473823782],
    ],
    [
      {
        weight: 1,
      },
      [0.8241000051752044, 0.1061000028121472, 0.8586836854624949],
    ],
    [
      {
        weight: 0,
      },
      [0.47120000698576636, 0.07039999976053661, 223.44001107929404],
    ],
    [
      {
        weight: 0.5,
        method: 'shorter',
      },
      [0.6476500060804854, 0.0882500012863419, 292.1493473823782],
    ],
    [
      {
        weight: 0.5,
        method: 'longer',
      },
      [0.6476500060804854, 0.0882500012863419, 112.14934738237824],
    ],
    [
      {
        weight: 0.5,
        method: 'increasing',
      },
      [0.6476500060804854, 0.0882500012863419, 112.14934738237824],
    ],
    [
      {
        weight: 0.5,
        method: 'decreasing',
      },
      [0.6476500060804854, 0.0882500012863419, 292.1493473823782],
    ],
  ],
  srgb: [
    [
      {
        weight: 0.5,
      },
      [0.5744899843543774, 0.5252921410815925, 0.6147851204581418],
    ],
    [
      {
        weight: 1,
      },
      [0.9999785463111585, 0.6599448662991679, 0.758373017125016],
    ],
    [
      {
        weight: 0,
      },
      [0.14900142239759617, 0.39063941586401707, 0.47119722379126755],
    ],
  ],
  'srgb-linear': [
    [
      {
        weight: 0.5,
      },
      [0.5096647054609955, 0.25972630442483197, 0.36200193586790025],
    ],
    [
      {
        weight: 1,
      },
      [0.999951196094508, 0.3930503811476254, 0.5356603778005655],
    ],
    [
      {
        weight: 0,
      },
      [0.01937821482748292, 0.12640222770203852, 0.18834349393523497],
    ],
  ],
  'display-p3': [
    [
      {
        weight: 0.5,
      },
      [0.5836172975616658, 0.530184139982079, 0.609686907635745],
    ],
    [
      {
        weight: 1,
      },
      [0.9510333333617188, 0.6749909745845027, 0.7568568353546363],
    ],
    [
      {
        weight: 0,
      },
      [0.2162012617616128, 0.38537730537965537, 0.46251697991685353],
    ],
  ],
  'a98-rgb': [
    [
      {
        weight: 0.5,
      },
      [0.5865373142666512, 0.5222346343208055, 0.6071485436534567],
    ],
    [
      {
        weight: 1,
      },
      [0.9172837001828321, 0.6540226622083835, 0.7491144397116841],
    ],
    [
      {
        weight: 0,
      },
      [0.25579092835047035, 0.3904466064332277, 0.4651826475952292],
    ],
  ],
  'prophoto-rgb': [
    [
      {
        weight: 0.5,
      },
      [0.5427628071521571, 0.4757810859208764, 0.5419635611723659],
    ],
    [
      {
        weight: 1,
      },
      [0.842345736209146, 0.6470539622987257, 0.7003583323790157],
    ],
    [
      {
        weight: 0,
      },
      [0.24317987809516806, 0.304508209543027, 0.3835687899657161],
    ],
  ],
  rec2020: [
    [
      {
        weight: 0.5,
      },
      [0.5494120530883964, 0.4907232619435038, 0.5681615893671463],
    ],
    [
      {
        weight: 1,
      },
      [0.8837118321235519, 0.6578067923850563, 0.7273197917658354],
    ],
    [
      {
        weight: 0,
      },
      [0.21511227405324085, 0.32363973150195124, 0.4090033869684574],
    ],
  ],
  xyz: [
    [
      {
        weight: 0.5,
      },
      [0.36838948901950813, 0.3202564721891328, 0.38490473490885063],
    ],
    [
      {
        weight: 1,
      },
      [0.6495957411726918, 0.5323965129525022, 0.575341840710865],
    ],
    [
      {
        weight: 0,
      },
      [0.08718323686632445, 0.10811643142576338, 0.19446762910683624],
    ],
  ],
  'xyz-d50': [
    [
      {
        weight: 0.5,
      },
      [0.37407596368010154, 0.32153582267804004, 0.29081645447205257],
    ],
    [
      {
        weight: 1,
      },
      [0.6640698533004002, 0.5367266625281085, 0.4345958246720296],
    ],
    [
      {
        weight: 0,
      },
      [0.08408207405980274, 0.10634498282797152, 0.14703708427207543],
    ],
  ],
  rgb: [
    [
      {
        weight: 0.5,
      },
      [146.49494601036622, 133.9494959758061, 156.77020571682615],
    ],
    [
      {
        weight: 1,
      },
      [254.9945293093454, 168.28594090628783, 193.38511936687908],
    ],
    [
      {
        weight: 0,
      },
      [37.99536271138702, 99.61305104532435, 120.15529206677323],
    ],
  ],
  hsl: [
    [
      {
        weight: 0.5,
      },
      [268.816848125996, 75.96890150160368, 57.00305146997975],
    ],
    [
      {
        weight: 1,
      },
      [342.6320467744765, 99.98738302509669, 82.99617063051632],
    ],
    [
      {
        weight: 0,
      },
      [195.00164947751546, 51.95041997811069, 31.009932309443187],
    ],
    [
      {
        weight: 0.5,
        method: 'shorter',
      },
      [268.816848125996, 75.96890150160368, 57.00305146997975],
    ],
    [
      {
        weight: 0.5,
        method: 'longer',
      },
      [88.816848125996, 75.96890150160368, 57.00305146997975],
    ],
    [
      {
        weight: 0.5,
        method: 'increasing',
      },
      [88.816848125996, 75.96890150160368, 57.00305146997975],
    ],
    [
      {
        weight: 0.5,
        method: 'decreasing',
      },
      [268.816848125996, 75.96890150160368, 57.00305146997975],
    ],
  ],
  hwb: [
    [
      {
        weight: 0.5,
      },
      [268.816848125996, 40.447314434838205, 26.4412114948787],
    ],
    [
      {
        weight: 1,
      },
      [342.6320467744765, 65.99448662991679, 0.002145368884157506],
    ],
    [
      {
        weight: 0,
      },
      [195.00164947751546, 14.90014223975961, 52.880277620873244],
    ],
    [
      {
        weight: 0.5,
        method: 'shorter',
      },
      [268.816848125996, 40.447314434838205, 26.4412114948787],
    ],
    [
      {
        weight: 0.5,
        method: 'longer',
      },
      [88.816848125996, 40.447314434838205, 26.4412114948787],
    ],
    [
      {
        weight: 0.5,
        method: 'increasing',
      },
      [88.816848125996, 40.447314434838205, 26.4412114948787],
    ],
    [
      {
        weight: 0.5,
        method: 'decreasing',
      },
      [268.816848125996, 40.447314434838205, 26.4412114948787],
    ],
  ],
  'xyz-d65': [
    [
      {
        weight: 0.5,
      },
      [0.36838948901950813, 0.3202564721891328, 0.38490473490885063],
    ],
    [
      {
        weight: 1,
      },
      [0.6495957411726918, 0.5323965129525022, 0.575341840710865],
    ],
    [
      {
        weight: 0,
      },
      [0.08718323686632445, 0.10811643142576338, 0.19446762910683624],
    ],
  ],
};
